{% extends 'layout/base.html' %}
{% load static %}

{% block css %}

    <link rel="stylesheet" href="{% static 'css/blog/account.css' %}">

{% endblock css %}

{% block title %}登录{% endblock title %}

{% block navbar %}
    <nav class="navbar navbar-inverse">
        <div class="container">
            <div class="navbar-header">
                <button type="button" class="navbar-toggle collapsed" data-toggle="collapse"
                        data-target="#bs-example-navbar-collapse-1" aria-expanded="false">

                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                    <span class="icon-bar"></span>
                </button>
                <a class="navbar-brand" href="{% url 'blog:index' %}">Home</a>
            </div>

        </div>

    </nav>
{% endblock navbar %}

{% block content %}
    <div class="account">
        <div class="title">用户登录</div>
        <br/>
        <form class="form-horizontal" method="post" novalidate>
            {% csrf_token %}
            {% for field in form %}
                <div class="form-group">
                    <label class="col-sm-2 control-label" for="{{ field.id_for_label }}">{{ field.label }}</label>
                    <div class="col-sm-10">
                        {{ field }}
                        <span class="error-msg">{{ field.errors.0 }}</span>
                    </div>
                </div>
            {% endfor %}

            <div class="form-group">
                <div class="col-sm-offset-2 col-sm-5">
                    <button type="submit" class="btn btn-primary">登录</button>
                    <a href="{% url 'oauth:weibo_login' %}">
                        <button type="button" class="btn btn-default">微博登录</button>
                    </a>
                </div>
            </div>
        </form>
    </div>
{% endblock content %}